home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / RCSC.ZIP / BIN / GENLIB.AWK < prev    next >
Text File  |  1997-01-12  |  874b  |  34 lines

  1. #********************************************************
  2. #This is part of the Retargetable Concurrent Small C
  3. #distribution (8051 version)
  4. #Copyright 1997 Andy W. K. Yuen
  5. #********************************************************
  6. #program to create a header which consists of all library
  7. #source files that need to be included for a RCSC program
  8. #this program is intended to be invoked with the command
  9. #line option:
  10. #     -v path=rcsc_pathname
  11. #
  12. BEGIN{
  13.     file = sprintf("%s\\file.idx", path)
  14.     while ((getline line[++linecnt] < file) > 0) {
  15.         split(line[linecnt], name, ":")
  16.         symbol[linecnt] = name[1]
  17.     }
  18. }
  19.  
  20. {
  21.  
  22. if (length($3) != 0) {
  23.     for (i = 1; i <= linecnt; i++) {
  24.         if ($3 == symbol[i]) {
  25.             count = split(line[i], name, ":")
  26.             for (j = 2; j <= count; j++) {
  27.                 printf "#include \"%s\\%s\"\n", path, name[j]
  28.                 }
  29.             break;
  30.             }
  31.         }
  32.     }
  33. }
  34.